Show SharePoint Documents in a Custom Dynamics 365 Page With Three Web API Calls
Summary Our team wanted to see a project’s files without leaving the Project Dashboard in our Team Hub, a set of custom pages we run inside Dynamics 365. The files live in SharePoint, and the Dynamics 365 form already shows them on its Documents tab. Our custom page had no such tab. We added a Documents tab that lists the same SharePoint files, using three calls to the Dataverse Web API and the session you already have. There’s no Power Automate flow, no SharePoint connector and no app registration. You open the tab, see each file with its type and a link, and open it in the browser. Table of Contents Summary→ Business Challenges→ Solution Overview→ Technical Approach→ Impact→ Conclusion→ Call to Action→ Business Challenges A team member checking a project in the Hub had to leave it to find the project’s documents. They opened the Project record, went to its Documents tab, then came back to the dashboard. The usual fixes to bring those files into a custom page add moving parts we didn’t want to own: A Power Automate cloud flow with the SharePoint connector, which adds a flow to build, run and maintain A direct call to Microsoft Graph or the SharePoint REST API, which needs an app registration and a second sign-in We wanted the files the form already shows, through the sign-in you already have. Solution Overview Dynamics 365 has server-based SharePoint integration. That’s the feature that connects a record to a SharePoint folder and fetches the files on your behalf. The form’s Documents tab uses it, and so can your own page. Our Documents tab asks Dataverse, the data layer behind Dynamics 365, for three things in a row: the project’s SharePoint folder, its full address and the files inside it. Dataverse talks to SharePoint for us. 1Find the folderLook up the SharePoint document location linked to the project 2Get the addressAsk for the full folder URL, the same one behind the form’s Open Location 3List the filesQuery the sharepointdocument virtual table with FetchXML We built the tab for desktop. At phone width (below 720 px) we hide it. Technical Approach You can follow these steps for any record that has a SharePoint document location. We used Project (msdyn_project) as the example. Find the document locationQuery sharepointdocumentlocations for an active row whose regarding record is your project. Take the oldest one. No row means the project has no SharePoint folder yet, and our tab says so. Get the folder addressCall RetrieveAbsoluteAndSiteCollectionUrl on that location. You get AbsoluteUrl and SiteCollectionUrl back. We use AbsoluteUrl for an Open in SharePoint button. Run this call and the file list in parallel. List the files with FetchXMLSend FetchXML to the sharepointdocument virtual table with a GET request. The query shape matters, see the code below. Show the outputRender each row with its name, a type badge, the modified date, who modified it and a link. Steps 1 and 2: location and folder addresshttp GET /api/data/v9.2/sharepointdocumentlocations?$select=sharepointdocumentlocationid&$filter=_regardingobjectid_value eq <projectId> and statecode eq 0&$orderby=createdon asc&$top=1 GET /api/data/v9.2/sharepointdocumentlocations(<locationId>)/Microsoft.Dynamics.CRM.RetrieveAbsoluteAndSiteCollectionUrl() // AbsoluteUrl looks like: // https://<tenant>.sharepoint.com/msdyn_project/<folder name>_<record id without dashes> Our first FetchXML was simpler. It used isrecursivefetch 0, no uitype, and a GUID without braces. Dataverse returned HTTP 400 with error 0x80040216, "An unexpected error occurred", from the plugin Microsoft.Crm.ObjectModel.SharePointDocumentService. We fixed it by copying the exact query shape the form’s own Documents grid sends. Step 3: sent as GET /api/data/v9.2/sharepointdocuments?fetchXml=<urlencoded>xml <fetch distinct="false" mapping="logical" page="1" count="100"> <entity name="sharepointdocument"> <attribute name="fullname"/> <attribute name="absoluteurl"/> <attribute name="filetype"/> <attribute name="modified"/> <attribute name="sharepointmodifiedby"/> <attribute name="isfolder"/> <attribute name="relativelocation"/> <order attribute="relativelocation" descending="false"/> <filter><condition attribute="isrecursivefetch" operator="eq" value="1"/></filter> <link-entity name="msdyn_project" from="msdyn_projectid" to="regardingobjectid" alias="bb"> <filter type="and"><condition attribute="msdyn_projectid" operator="eq" uitype="msdyn_project" value="{<projectId>}"/></filter> </link-entity> </entity> </fetch> 💡Three details that made it work Set isrecursivefetch to 1, add uitype on the link-entity condition, and wrap the GUID in braces. The output In our live test, one project returned 7 items and another returned 17, each with a name, file type and direct link. Two fixes came out of my own testing. Clicking absoluteurl downloaded Office files, so we add ?web=1 to file links and SharePoint opens them in the browser. Folders keep the plain link. A single grey icon for every file didn’t help anyone, so we show coloured badges from filetype: W for Word, X for Excel, P for PowerPoint, N for OneNote and PDF in red. We hide the folder column if every file sits in one folder. 1 Coloured type badges and direct links to each file The Documents tab listing a project’s SharePoint files. Speed shaped one decision. The file list took 2.1 s and 2.5 s in our tests, because Dynamics 365 asks SharePoint live each time. The location and URL calls take about 0.25 s. So we load files the moment you open the Documents tab and never on dashboard load. A skeleton shows while you wait, and we cache the result until you press Refresh. ⚠Limits We cap the list at 100 items per project and show a note to open SharePoint for the rest. We haven’t yet tested what a lower-privilege user sees. Impact Your team sees a project’s SharePoint files inside the custom page, with nothing new to run or sign in to. 3Dataverse Web API calls 0Cloud flows or connectors 0Extra sign-ins or app registrations ~2 sTo list files for one project We haven’t measured time saved. The change is in the mechanism. Before Leave the dashboard Open the Project record Go to its Documents tab Files sat one form away After Open a tab Open the Documents tab in the Hub Click a file to open it in the browser 3 calls through your D365 session Takeaways if you want the same thing in your own page: Copy the query the form’s Documents grid sends before you write your own FetchXML Load SharePoint files on demand, since each fetch goes to SharePoint live Add ?web=1 to Office file links so they open in the browser Conclusion Dynamics 365 already talks to SharePoint for you. We … Continue reading Show SharePoint Documents in a Custom Dynamics 365 Page With Three Web API Calls
How a Leading North American Commercial Vehicle Manufacturer Surfaced Custom Warehouse Data on the Work Lines Form in Dynamics 365 Finance & Supply Chain Management Using an X++ Display Method
WHSWorkLine Display Method Summary The All work lines form in D365 Finance & Operations only shows what the WHSWorkLine table already knows. When the warehouse floor needs a piece of operational context that lives in a different table entirely, the usual instinct is to add a field, which means touching the base table, or worse, customizing a standard form. This post walks through a smaller, upgrade-safe alternative: a table extension that adds a cached display method to WHSWorkLine, sourced from a custom table, and surfaced as a grid column on the standard work lines form, with no schema change and no per-row database hit on every refresh. The example comes from an engagement with a North American truck manufacturer, where warehouse supervisors needed a load-staging reference visible directly on the work line grid instead of a separate lookup screen. On this page 01The business challenge 02Why a table extension 03The display method 04What SysClientCacheDataMethod buys you 05Wiring it onto the form 06Performance notes and gotchas 07Where else this pattern fits 08FAQs 09Conclusion The business challenge Warehouse supervisors were working two screens at once: the standard All work lines form to track pick and put progress, and a second lookup to check which loading door or staging note applied to each line. Every work line already carried that answer; it just lived in a custom table keyed off the same WorkId and LineNum that WHSWorkLine uses. The fix didn’t need a new field, a new form, or a modification. It needed one existing screen to know how to ask a second table a question it already had the key for. Why a table extension, not a table field Three reasons ruled out adding a real field to WHSWorkLine: It’s a Microsoft table. Extending it directly means overlayering, which blocks upgrades and one-version-back servicing. The data isn’t really work-line data. It’s staging metadata that happens to be looked up by work line. Storing it separately keeps the source table’s purpose clean. A display method needs no migration. Chain of Command ([ExtensionOf]) attaches new behavior to the table without altering its schema, so the change ships and rolls back like any other extension package. That leaves one job: write a static display method on a table extension class that reads the custom table and returns a string, then tell the form which column should call it. The display method The extension class attaches to WHSWorkLine. The method itself is a plain lookup against the custom table on the composite key WorkId + LineNum: WHSWorkLine_Extension.xpp [ExtensionOf(tableStr(WHSWorkLine))] final class WHSWorkLine_Extension { [SysClientCacheDataMethod] public static display str customWorkLineData(WHSWorkLine _whsWorkLine) { WHSWorkLineCustom workLineCustom; select firstOnly Data from workLineCustom where workLineCustom.WorkId == _whsWorkLine.WorkId && workLineCustom.LineNum == _whsWorkLine.LineNum; return workLineCustom.Data; } } Nothing exotic: a display method is just a method whose return value a form can bind a column to. Because it’s static and takes the buffer as a parameter, the compiler treats it as a table-level display method rather than a form data-source method, which is what makes it reusable from more than one place. What SysClientCacheDataMethod buys you Without that attribute, a grid re-evaluates a display method every time the row is redrawn: scrolling, sorting, refreshing, even just switching focus between forms can trigger it again. On a work line grid that can hold several thousand rows during a shift, that’s a select statement repeated far more often than the underlying data ever changes. SysClientCacheDataMethod tells the client: compute this value once per record, cache it locally, and reuse the cached value instead of calling back to the server on every redraw. “A cached display method turns a per-scroll database call into a one-time lookup per record. That’s the difference between a grid that feels instant and one that stutters under load.” Wiring it onto the form The method lives on the table; the form still needs to be told to use it. Three steps, all done as an extension of the standard form: 1Create a form extension for the work lines form and open its design in the tree. 2Add a new String Control under the grid’s data source and set its Data Method property to customWorkLineData, not Data Source / Data Field, since the value isn’t a stored field. 3Set a Label and Width, position the column where the floor team expects it, then build and synchronize. Performance notes and gotchas Client-side caching means stale values are possible. If another user updates the custom table after the grid has already cached a row’s value, that column won’t refresh until the form re-queries the record. Fine for staging notes that don’t change mid-shift; not fine for anything that must be live to the second. Keep the lookup narrow. select firstOnly on an indexed composite key (WorkId, LineNum) is cheap. A display method with a join, a loop, or an unindexed filter defeats the point of caching it. No custom data doesn’t mean an error. Most work lines in this scenario won’t have a row in the custom table; the method should just return an empty string, which it does here by construction. Rule of thumb: if the source data can change while the form is open and the user needs to see that change immediately, don’t cache it. Cache display methods for data that’s set once and read many times. Where else this pattern fits Nothing here is specific to warehouse work lines. The same three pieces (a table extension, a cached display method, and a form control bound by Data Method) apply anywhere a grid needs to show a value that’s derived or looked up rather than stored on the row itself: sales order lines pulling a commitment note, purchase lines surfacing a vendor scorecard flag, or any list page where the “one more column” request would otherwise mean modifying a Microsoft table. FAQs 1Does this require modifying the WHSWorkLine table? No. [ExtensionOf(tableStr(WHSWorkLine))] uses Chain of Command to attach the method without an overlayer or schema change, so it ships as a standard … Continue reading How a Leading North American Commercial Vehicle Manufacturer Surfaced Custom Warehouse Data on the Work Lines Form in Dynamics 365 Finance & Supply Chain Management Using an X++ Display Method
Every Target Traced to a Deal: Dynamics 365 Sales Visibility for an Australian Commercial Laundry Provider
Summary Sales managers at an Australian garment and linen laundry provider could see team targets on Dynamics 365 Goal charts, but they could not open the deals behind any figure. We paired each goal with Opportunity charts that share its rollup query filters. Managers now go from a missed target to the specific opportunities on one dashboard. Each dot on a Goal Progress chart is a field on a single goal record, so a click has nothing to group by. We added three system charts on the Opportunity table beside the Goal charts on the Sales Manager dashboard, with no custom code. This work builds on our wider Dynamics 365 Sales engagement with the same client. Read the full case study: Transforming Sales Operations for a Leading Australian Linen & Garment Services Provider. GA Garment and linen laundry services organizationAnonymised Industry Commercial laundry and linen services Region Australia Users Sales managers and their salespeople KPIs tracked Signed contracts and new contract revenue StackDynamics 365 SalesGoals and goal metricsRollup queriesSystem chartsModel-driven dashboards Table of Contents Summary→ Business Challenges→ Solution Overview→ Technical Approach→ Impact→ Conclusion→ Next Step→ Business Challenges The Sales Manager dashboard told managers how far each salesperson was from target, and then stopped. Each salesperson carried two annual goals, one for signed contracts and one for new contract revenue, and the two Goal Progress charts plotted them well. The trouble started with the follow-up question about which deals sat behind a low Actual. A dot that led nowhere. Clicking Target, Actual or In-progress on a Goal chart did not open a single opportunity Filters rebuilt by hand. Managers left the dashboard, opened an opportunity view, and set owner and close date range themselves for every salesperson they wanted to check Two totals for one question. The hand-built view often disagreed with the goal’s Actual, and nobody could say which one was right No way to tell weak sales from bad data. A low Actual could mean few contracts signed, or a signed contract whose opportunity was never closed as Won One-to-ones that opened with data gathering. The first part of each coaching session went on assembling the list of deals to talk about Managers liked the Goal charts and did not want them replaced. The brief was narrow: keep the target view, and add a direct route from it to the opportunity records. Solution Overview We rebuilt the Sales Manager dashboard so the Goal charts keep showing progress and a second row of Opportunity charts explains it. Both rows count the same deals, because each Opportunity chart uses the same owner, status and close date rules as the goal it sits beside. The dashboard now reads top to bottom in the order a manager works through a review. Top row, the targets. Goal Progress charts for signed contracts and new contract revenue, one category per salesperson Middle row, the deals. Won Opportunities by Owner, Actual Revenue by Owner, and Open Pipeline by Owner and Stage. A manager clicks a salesperson’s bar, regroups it by month, account or sales stage, and opens the records Bottom row, the follow-up. The Team KPI Goals grid for opening any goal record, and an open pipeline view for deals that still need action 1 2 3 Goal Progress charts show Target, Actual and In-progress for each salesperson Opportunity charts with drill-down by owner, month, account and stage Team KPI Goals grid and open pipeline view for follow-up The redesigned Sales Manager dashboard, read from targets at the top to follow-up at the bottom Everything on the page is standard Dynamics 365 Sales configuration. There is no plugin, no JavaScript and no custom control to carry through future releases. Technical Approach The design rests on one mechanism: the rollup query that feeds a goal’s Actual is also the filter for the chart that explains it. The rest of this section covers why the Goal chart cannot do the job alone, how we wired the two together, and where the numbers can still drift apart. Why can’t you drill down on a Dynamics 365 Goal chart? A Goal Progress chart has nothing underneath a data point to drill into. It is a multi-series chart on the Goal table, where each category on the horizontal axis is one goal record and each dot is a column on that record: Target, Today’s Target, Actual or In-progress. Drill-down in a model-driven app regroups the rows inside a chart segment by another column. One goal record is one row. The won opportunities that produced the Actual live in a different table, and a system chart cannot drill across tables. Where does a goal’s Actual figure come from? The Actual and In-progress values come from rollup queries attached to the goal, evaluated against the goal owner’s records for the goal period. That makes the rollup query the only reliable definition of which deals count. TargetGoal recordOne per salesperson, per KPI, per year RuleRollup queryOwner, status and close date in period RecordsOpportunity tableWon and open opportunities ExplainOpportunity chartSame filter, drill-down enabled ReviewSales Manager dashboardTarget and deals on one page We wrote the rules down once and used them in both places. The table below is the mapping we configured for the two KPIs. Goal value Records counted Date tested against the goal period Matching chart Signed Contracts, Actual (count) Won opportunities owned by the goal owner Actual Close Date Won Opportunities by Owner New Contract Revenue, Actual (money) Won opportunities owned by the goal owner, summed on Actual Revenue Actual Close Date Actual Revenue by Owner In-progress, both KPIs Open opportunities owned by the goal owner Est. Close Date Open Pipeline by Owner and Stage Goal values and the Opportunity charts that mirror them, from this project Build sequence Confirm the goal metric and its rollup fieldsFor each metric, check the source table, the status that counts, and the date column used for Actual and for In-progress. These three settings decide everything the charts must copy. Attach a rollup query to each … Continue reading Every Target Traced to a Deal: Dynamics 365 Sales Visibility for an Australian Commercial Laundry Provider
Why Is Consumption Quantity Showing Zero in Dynamics 365 Business Central? A Pharma Manufacturing Case
Summary A pharmaceutical manufacturer running Microsoft Dynamics 365 Business Central found that the raw and packing material (RM/PM) consumption quantity on a released production order stayed at zero in the Production Journal. After reviewing the case with Microsoft Support, we confirmed it was standard behavior, not a bug. The production location requires warehouse picks, and Business Central fills consumption only from picks that have been registered. Three setup gaps were blocking the pick: no lot-tracked stock in the pick bin, the same bin used for Take and Place, and a missing number series for registered picks. We fixed all three and wrote the process as three rules the team now follows on every production order. Table of Contents Introduction How Business Central Fills Consumption Quantity Why the Pick Could Not Be Registered Rule 1: Confirm Inventory for Every Component Rule 2: Record Missing Stock with a Positive Adjustment Rule 3: Create and Register the Warehouse Pick The Result in the Production Journal Quick Troubleshooting Checklist Business Impact Frequently Asked Questions Conclusion Introduction In Microsoft Dynamics 365 Business Central, the Production Journal is where planners post output and the consumption of raw and packing materials. Usually the consumption quantity is filled in for you. When it shows zero, the order cannot be completed correctly. This is what a pharmaceutical manufacturer we work with ran into. A production order had been released, the components were listed, and the stock was physically on the shop floor. Yet every RM/PM line in the Production Journal showed a consumption quantity of 0. Figure 1: The symptom: every RM/PM consumption line in the Production Journal shows 0. 0 Consumption quantity on every RM/PM line 3 Setup gaps blocking the warehouse pick 3 Simple rules that fixed it We reviewed the scenario with Microsoft Support and confirmed that Business Central was working as designed. The real issue was a missing step earlier in the process. The Lesson At a location that requires warehouse picks, consumption follows the pick. No registered pick means no consumption quantity. How Business Central Fills Consumption Quantity How Business Central calculates consumption depends on the warehouse setup of the location on the production order. The client’s production location was set up to require warehouse picks for production consumption. No Pick Required Expected Quantity Consumption is proposed from the expected quantity on the component lines, based on the BOM and the order quantity. Pick Required Picked Quantity Consumption is proposed only from the quantity that has been picked and registered to the To-Production bin. Until a pick is registered, the quantity stays at 0. How consumption is filled at a pick-required location Stock in Pick Bin → Create Warehouse Pick → Register Pick → Qty. Picked Updated → Consumption Filled Figure 2: Qty. Picked on the components is 0, so there is nothing for the Production Journal to consume. Key Insight A zero consumption quantity is a symptom, not the problem. The question to ask is why the pick was not registered. Why the Pick Could Not Be Registered We worked back from the Production Journal to the warehouse pick and found three gaps. Any one of them is enough to stop a pick from being registered. 01 No Stock in the Pick Bin Some RM/PM items had no inventory, with lot number and expiry date, in the bin used for picking. Nothing was available to pick. 02 Same Bin for Take and Place The bin holding the stock was also set as the To-Production bin. A pick moves stock from one bin to another, so these must be different. 03 Missing Number Series Registered Whse. Pick Nos. was not set up correctly in Warehouse Setup, so a registered pick could not be numbered. Figure 3: The original pick: Take and Place pointed to the same bin, and two components had no stock to take. From these findings we wrote three rules. The team follows them in order whenever the consumption quantity is zero. Rule 1: Confirm Inventory for Every Component If the consumption quantity is zero, start by checking stock. Without inventory in the right location and bin, nothing can be picked. Search for Items and open the RM/PM item. Check Inventory for the production location. Open Bin Contents and check the bin you pick from, for example STORE-B1. For lot-tracked items, confirm the stock in that bin has a lot number and expiry date. Figure 4: Item Ledger Entries confirmed two components had never been received at the production location. Figure 5: Bin Contents of the stock bin show which components are available to pick. Good to Know Stock in a different bin, or at a different location, does not count. The pick only looks in the bins of the location on the production order. Rule 2: Record Missing Stock with a Positive Adjustment If the material is physically on the shelf but not in the system, record it with a positive adjustment in the right bin and with the right lot details. Search for Item Journals. Create a line with Entry Type Positive Adjmt., the Item No., the Location Code, the Bin Code you pick from (for example STORE-B1), and the Quantity. Open Item Tracking Lines and assign the Lot No. and Expiration Date. Post the journal. Open Bin Contents again and confirm the stock now shows in the bin. Figure 6: Lot-tracked items need a Lot No. and Expiration Date before the journal will post. Figure 7: A positive adjustment line posting the missing stock into the stock bin. Use with Care A positive adjustment is only for stock that physically exists but is not yet recorded. RM/PM stock should normally come in through a purchase receipt or a transfer order. Rule 3: Create and Register the Warehouse Pick Once stock is available, the pick needs two different bins: one to take from and one to place into. This needs a one-time setup per location, followed by the same steps on each production order. One-Time Setup per Location Location … Continue reading Why Is Consumption Quantity Showing Zero in Dynamics 365 Business Central? A Pharma Manufacturing Case
How We Built a Role-Based Customer Portal in Microsoft Power Pages for a US-Based IT Services Provider
Summary This portal was built for Invoke, a Texas-based Microsoft partner. The wider engagement, covering Dynamics 365 Project Operations, Power BI reporting and QuickBooks integration, is described in our Invoke case study. A customer portal that filters records only in page code exposes data the moment someone calls the Web API directly. We built a role-based customer portal in Microsoft Power Pages where Dataverse table permissions decide access, and Liquid with FetchXML only shapes the view. One Service Requests page now serves three user scopes. Global users see every request, department users see their department’s requests, and regular users see their own. Contacts from the same account share that account’s subscriptions, contracts, projects and invoices. Dashboard tiles use aggregate queries scoped the same way as the lists, and search and paging run on the server at ten rows per request. This Blog Explains How web roles and table permission access types map to global, department and personal visibility How one Liquid template with a FetchXML query replaces a separate page per role How the Account access type gives every contact in a customer organisation the same subscriptions, contracts, projects and invoices How aggregate FetchXML keeps dashboard counts in step with the lists behind them How a negative test through the Web API proves the security model before go-live Introduction For a portal user, the question “Which service requests can I see, and why can my colleague see more?” should have one answer, wherever they ask it. In a portal built page by page, the answer changes with the route. The list page hides a row, the details page opens it from a pasted URL, and the Web API returns it without complaint. Power Pages gives a developer two places to apply a visibility rule. One is the page, through Liquid and JavaScript. The other is Dataverse, through web roles and table permissions. Only the second one follows the user to every list, form and API call. This post covers how we used both, each for the job it suits, and the two points where our first design was wrong. Table of Contents Summary→ The Business Problem→ The Solution→ Technical Approach→ Business Impact→ Conclusion→ Ready to Build a Secure Customer Portal?→ The Business Problem The portal had to show each signed-in contact the right slice of Dataverse without a separate page per audience and without trusting the browser. Service requests have three audiences. Subscriptions, contracts, projects and invoices belong to a customer account, and several contacts from that account need the same view of them. When each page carries its own filtering logic, four recurring problems appear: Duplicated pages: A Service Requests page per role means three templates, and every new column is added three times Security that lives in the template: A Liquid if hides rows on one page and does nothing for another list, a basic form or a /_api/ call from the browser console Counts that disagree: Dashboard tiles built with their own queries show numbers the user cannot reproduce by opening the list Slow lists: Loading every case and filtering in JavaScript works in testing and degrades once the table holds thousands of rows The Solution We designed around one rule: Dataverse decides what a contact may read, and the page decides how to present it. Every visibility requirement had to be expressed as a table permission first. Liquid and FetchXML then narrow and arrange what the permission already allows. IdentitySigned-in contactAuthenticated through the portal identity provider RoleWeb roleGlobal Users, Department Users or Regular Users SecurityTable permissionsGlobal, Account or Contact access type per table QueryLiquid and FetchXMLOne query, filter chosen by role PageList and dashboardTen rows per request, counts from aggregates For a business user the result is plain. Two people from the same customer open the Invoices page and see the same invoices. A person from a different customer sees none of them, whichever route they use to ask. The sections below explain how each part closes a gap in the page-by-page approach. Figure 1: Portal sign-in page. Each user authenticates as a contact before any web role applies. Technical Approach We built in a fixed order: permissions first, queries second, interaction last. A query written against an open table hides permission gaps until late, so the table permissions were configured and tested before any web template existed. 1. Web Roles and Table Permissions as the Security Boundary Each portal user is a contact, each contact holds one or more web roles, and each web role carries table permissions. A table permission names a table, a privilege such as Read, and an access type. Power Pages offers Global, Contact, Account and Self access types, plus child permissions that inherit from a parent table. Web role Table Access type Record must relate to Global Users Case (incident) Global Nothing, all rows are readable Department Users Case (incident) Account The contact’s parent account through the case customer Regular Users Case (incident) Contact The signed-in contact as primary contact on the case All three roles Subscription, Contract, Project, Invoice Account The contact’s parent account Table 1: Read permissions configured for this portal. Create and Write were granted separately and only where a form needed them. 2. Where a Department Lives in the Data Model Power Pages has no Department access type, so a department has to be expressed as something the permission model understands. Our first design used a custom department lookup on the case, a Global permission for department users, and a FetchXML condition to narrow the rows. It rendered correctly and failed the first negative test, because the Web API ignored the page filter and returned every case. Criteria Global permission plus Liquid filter Our choiceDepartment as an account record Page shows only department rows ✓ ✓ Web API call returns only department rows ✗ ✓ Other lists and forms inherit the rule ✗ ✓ No change to the Dataverse data model partial ✗ We reversed the decision and moved departments into the account hierarchy as … Continue reading How We Built a Role-Based Customer Portal in Microsoft Power Pages for a US-Based IT Services Provider
From Scattered Reports to One Click: A Client-Ready Project Report Inside Dynamics 365
Summary A client asks for a project update, and the project manager starts a tour of SSRS reports, Power BI pages and notes before anything reaches a slide. We built a client-ready project report that comes from one page in our custom Project Hub. One button downloads a paged PDF with the project summary, hours, utilization and progress, drawn in the browser with jsPDF. Table of Contents Summary→ Business Challenges→ Solution Overview→ Solution Approach→ Impact→ Conclusion→ Next Step→ Business Challenges For most project managers, a client update means collecting the same figures from several places, every time. Open the reportsClick through to an SSRS report for task status, then a Power BI page for utilization and hours. Read and noteCopy budget, consumed hours, remaining hours and progress into notes, one project at a time. Stitch the documentPaste the figures and screenshots into PowerPoint or Word and shape them for the client. Check it againMake sure the totals in the deck still match the reports before it goes out. The work repeats for every client and every reporting cycle. A new figure the client wants usually means one more report to design and publish before the PM can even copy it. ⓘWhat a PM really needs One view of the project, and one document the client can read without a walkthrough. Solution Overview Not anymore. The PM opens the Project Dashboard in our Project Hub, reads the whole project on one page, and presses PDF. A complete, paged report downloads a moment later. 1 PDF builds the report from what is on screen The PDF button sits next to Copy and CSV. Why not print the dashboard to PDF? A screen print looks like a shortcut until you see it on paper. Charts split across pages, buttons and filters print with the data, and wide tables lose their right edge. A PDF made from screen images also has no selectable text, so the client cannot search it or copy a figure. We took a different route and drew the report ourselves, page by page, with a free library called jsPDF. Think of it as laying out a printed page by hand: each heading, table and figure sits in a set place, so the result reads like a report someone designed. What does the client-ready project report include? Each report follows the same order, so a client knows where to look from the second report onwards. A title block with the date and the scope: projects, any task filter and which hours count. A summary panel with budget, consumed, remaining or over, utilization, and a stacked bar of approved, submitted and other hours. Per project: the name with a health pill, six key figures, a progress bar with a budget mark, and a task table. A "Tasks utilization by resources" table, monthly hours, and a "Page n of N" footer. The PM installs nothing and opens no other tool. The report builds itself in the browser from the figures already on the page. Solution Approach Behind the button sits a simple idea: take the numbers the PM already trusts on screen and set them on paper the way a client wants to read them. What happens when the PM presses PDF? Pick the projectsThe PM selects one project or several in the Project Dashboard, with any task filter they need. Reuse what is on screenThe Hub takes the budget, hours, utilization and status it has already loaded from Dynamics 365. Nothing is retyped or copied. Lay out the pagesThe Hub writes the title, summary and one section per project onto A4 pages, adds page numbers, and repeats table headings when a table runs onto the next page. Download and sendA PDF lands in the PM’s downloads, ready to attach to an email or share in Teams. 1 2 3 One summary for everything selected Health at a glance for each project Who worked on what, by hours Page 1: the scope, the summary across all selected projects, and the first project sections. Each project gets the same layout: a health label, six key figures, a progress bar and the task table. A client reading the third report finds things where they found them in the first. How does this compare with the usual options? Criteria Screen print to PDF A separate SSRS or Power BI report Our choiceOne-click PDF from the Project Hub Reads well on paper ✗ ✓ ✓ Client can search and copy figures ✗ partial ✓ Same numbers the PM sees on screen ✓ partial ✓ No extra report to build and maintain ✓ ✗ ✓ Clicks to a client-ready file Several Several 1 A separate report can look good, but it needs its own design and its own copy of the project rules. The Hub PDF uses the rules the dashboard already follows, so the two never drift apart. What we learned along the way ▤Design for paper firstA layout that works on a wide screen rarely works on A4. We planned the page before we placed a single number. ↔Give every number its own spaceFigures and labels each have a fixed column, so a long status never sits on top of a percentage. ⧉Repeat headings on each pageWhen a task table runs onto the next page, its column titles come with it, and every page says Page n of N. ◎Look at every page before releaseEach change to the layout goes through a check that saves the PDF and turns each page into an image we review by eye. 💡Next on our list A project section that does not fit the bottom of a page will move to the next page as one piece, so its tables always stay together. Impact The PM goes from question to client-ready report without leaving Dynamics 365. 1 pageTo read the whole project in the Project Hub 1 clickTo download the client-ready PDF 0Extra SSRS or Power BI reports to build Page n of NNumbered footer on every page Before … Continue reading From Scattered Reports to One Click: A Client-Ready Project Report Inside Dynamics 365
Forecasting with Prophet-When Does It Make Sense
Summary Prophet is a forecasting method from Meta’s Core Data Science team. It works well for business numbers that follow repeating patterns, such as retail sales, website traffic, and revenue. This blog explains where Prophet helps, why it is easy to understand and use, and when it needs extra care. Table of Contents 01 Introduction 02 Retail Sales Forecasting: Planning for Demand 03 Forecasting Website Traffic and Infrastructure Needs 04 Forecasting Business Numbers: Growth and Operational Trends 05 Why Use Prophet? 06 When Prophet May Not Fit Well 07 Making Forecasts Useful for the Business 08 FAQs 09 Conclusion Introduction Every organization generates data. Sales, customer activity, website traffic, daily operations, and system usage all build up a history over time. The value of this data is not only in understanding what happened yesterday. It is also in preparing for what may happen next and making better decisions today. This is where forecasting is useful for business leaders. Prophet, developed by Meta’s Core Data Science team, is a practical way to forecast business numbers that follow repeating patterns, seasonal changes, and changing growth. However, Prophet is not suitable for every forecasting problem. How well it works depends on the business problem, the past data available, and the decisions the forecast will support. Where Prophet Can Help 1 Retail Sales Plan stock, purchasing and delivery around weekly, seasonal and holiday patterns. 2 Website Traffic Forecast visits and usage to plan how much system capacity is needed. 3 Business Numbers Forecast revenue, new customers and user growth for planning. 1. Retail Sales Forecasting: Planning for Demand Retail demand changes throughout the year. Sales are affected by weekly shopping habits, seasons, promotions, and holidays. These patterns directly affect inventory, purchasing, delivery planning, and revenue expectations. A 2020 research study, Application of Facebook’s Prophet Algorithm for Successful Sales Forecasting Based on Real-world Data, used Prophet on actual sales data from a large retail company in Bosnia and Herzegovina. The study showed how Prophet, together with testing on past data, can be used to forecast retail sales and check how reliable the forecast is for different products. Why Prophet Makes Sense Seasonal patterns: Retail sales often rise and fall on weekly and yearly cycles, and Prophet can include these. Holidays: Known holidays and special events can be added to the forecast. Changing trends: The forecast can allow sales trends to change instead of assuming steady growth. Many products: The same approach can be used for many products. The reliability of each product’s forecast should be checked separately. The goal is not only to predict sales. It is to help the business make better decisions about stock availability, purchasing schedules, delivery planning, and cash planning. A forecast is useful when it connects directly to a business decision. 2. Forecasting Website Traffic and Infrastructure Needs Websites and online platforms produce operational data all the time. Website visits, app usage, and system load often follow patterns based on weekdays, weekends, seasons, and business events. Meta’s original work on Prophet aimed to make business forecasting easier to use at a larger scale, including forecasting the numbers used to plan how much system capacity is needed. One example is using past website traffic to forecast future demand. The aim is to understand how traffic is likely to change and whether the current infrastructure can support it. Why Prophet Makes Sense More than one pattern: Daily traffic can follow both weekly and yearly patterns. Changing growth: Growth can change as products change or more people start using them. Capacity planning: Forecasts help infrastructure teams plan for future needs. Spotting differences: Forecasts can be compared with actual traffic to notice unexpected changes. For leaders, the benefit is linking the forecast to infrastructure spending decisions. Instead of relying only on past peak usage or reacting once demand rises, teams can use forecast demand as one more input when planning capacity. This is helpful when cost, system performance, and customer experience all need to be balanced. 3. Forecasting Business Numbers: Growth and Operational Trends Organizations regularly track numbers such as revenue, new customers, user activity, and operational volumes. Prophet was designed to support business forecasting at larger scale, including numbers such as revenue and user growth. These numbers often show repeating patterns, an overall growth trend, and changes caused by business events. Why Prophet Makes Sense Easy to understand: The trend and seasonal parts of the forecast make it easier to read and explain. Changing growth: It can handle growth that speeds up or slows down over time. Known business events: Events such as product launches can be included when their effect is described properly. Easy to review: Business teams can look at the trend and seasonal parts instead of receiving only a final number. This is useful when forecasts need to be reviewed and understood by finance, operations, and leadership, and not only by the data team. The forecast can support revenue planning, growth estimates, resource allocation, and operational reviews. One thing to keep in mind: a forecast of a business number does not explain why that number is changing. Understanding the effect of pricing, marketing campaigns, customer behavior, or other business factors may need additional analysis. Why Use Prophet? Prophet builds a forecast from parts of the past data: the trend, the seasonal patterns, and the effect of holidays and events. These parts reflect patterns that are common in business data, and they do not require a lot of manual setup. What Prophet Looks At The parts of past data that shape a Prophet forecast 1 Trend The general direction of the numbers over time. 2 Weekly patterns M T W T F S S Repeating changes across the days of the week. 3 Yearly patterns Jan Dec Repeating changes across the seasons of the year. 4 Holidays and events Known dates, such as holidays or product launches, that affect the numbers. From Past Data to a Business Decision 1 Past Business Data Sales, traffic, revenue or other numbers. 2 Prophet … Continue reading Forecasting with Prophet-When Does It Make Sense
How a Multi-Country Oil & Gas and Marine Services Provider Corrected Receipt Costs Before Inventory Closing in Dynamics 365 Finance & Operations
Correcting Receipt Costs Before Inventory Closing in Dynamics 365 Finance & Operations Summary Inventory closing in Dynamics 365 Finance & Operations settles issues against receipts. If a receipt carries the wrong cost, closing pushes that error into cost of goods sold and closing stock value. The client is a multi-country oil & gas and marine services provider, serving exploration and production operators from offices across the Middle East and Asia. They run Dynamics 365 Finance & Supply Chain Management for accounting, procurement, project management and inventory, with Power BI on top for reporting. During a month-end support engagement we found one receipt valued at a fraction of an identical earlier receipt. We corrected it through a transaction adjustment, recalculated the item, checked ageing and only then ran closing. The fix itself takes minutes. The order of the steps is what matters. Table of Contents 1. Business Challenges 2. Solution Overview 3. Approach & Methodology 4. Impact 5. FAQs 1. Business Challenges We found two receipts of the same item, at the same site and warehouse, for the same quantity of 5. Their values were far apart. Receipt Quantity Posted value Value per unit Receipt 1 5 23,050.15 4,610.03 Receipt 2 5 1,375.00 275.00 Same item, same site and warehouse, same quantity. If we had run closing on these values, two things would have happened. Every issue settled against the second receipt would have been settled at too low a cost, understating cost of goods sold. Inventory value at month-end would have been understated. 2. Solution Overview Closing uses the cost on each receipt to settle and adjust issues. When we correct the receipt first and then recalculate, D365 re-costs the dependent issues for us. Correcting after closing is more work. It means reversing the close or posting further adjustments in a later period. The sequence we follow: Correct the cost, recalculate the item, check ageing, then close. 1 Correct cost Transaction adjustment 2 Recalculate Re-costs dependent issues 3 Check ageing Confirm values flow through 4 Close Run on correct values Fix the receipt before anything settles against it. Reversing this order later means a reopened period. The correction sequence: cost first, then recalculation, then an ageing check, and only then closing. Reverse that order and a quick fix becomes a reopened period. 3. Approach & Methodology 1. Correct the item cost through a transaction adjustment Go to Inventory management > Periodic tasks > Closing and adjustment. Open a transaction adjustment. On the action pane, select Adjustment > Transactions. An adjustment voucher opens, dated the month-end. Choose the transactions. Select Select to choose the transactions to adjust. Filter by item. In the query, enter the item number in Criteria against the Item number field. Add other ranges such as financial date if needed, then select OK. Enter the correct unit cost. The item’s open receipts load with posted quantity and posted value. Select Adjustment > Item cost price and enter the correct unit cost. The Adjustment column shows the change per line. Post. Select Post. Recalculate the item. Run an item-wise Recalculation from Closing and adjustment, dated the month-end, so dependent issues pick up the corrected cost. Inventory management › Periodic tasks › Closing and adjustment Adjustment ▾Close procedure ▾RecalculationInquiries AdjustmentTransactions Voucher dateMonth-end Adjust transactions, query filtered by item number Receipt Posted qty Posted value Item cost price Adjustment Receipt 1 5 23,050.15 4,610.03 No change Receipt 2 5 1,375.00 4,610.03 +21,675.15 Posted, ready for recalculation Illustrative mockup of the Closing and adjustment / Adjust transactions flow, not an actual product screenshot. The item cost price adjustment lands on the under-valued receipt line and shows the resulting adjustment amount. 2. Check inventory ageing Review the inventory ageing report as on the month-end date. Confirm the corrected values flow through. Inventory management › Inquiries and reports › Inventory ageing CalculateExport ▾PrintInquiries As of dateMonth-end Item numberFiltered Inventory ageing by value as on the month-end date Item Qty on hand 0–30 days 31–60 days 61–90 days Total value Item (same item) 10 46,100.30 0.00 0.00 46,100.30 Corrected value flows through, both receipts now aligned Illustrative mockup of the Inventory ageing inquiry, not an actual product screenshot. After the adjustment and recalculation, the second receipt’s value lines up with the first and total inventory value is correct. 3. Run inventory closing In Closing and adjustment, select Close procedure > Close, set the month-end date and run it. Confirm the new closing line shows OK, and review the log if it has warnings. Inventory management › Periodic tasks › Closing and adjustment Close procedure ▾Adjustment ▾RecalculationInquiries Closing nameMonth-end close Closing dateMonth-end Close procedure > Close: closing run history Closing Closing date Run type Status Prior period Previous month-end Closing Closed Month-end close Month-end Closing Closed OK Closing completed with no errors in the log Illustrative mockup of Close procedure > Close, not an actual product screenshot. The closing run completes with status OK once it runs on the corrected receipt values. 4. Impact Before Correct after closing Issues settled at too low a cost flow into cost of goods sold Month-end inventory value is understated Fix needs a close reversal or later-period adjustments Rework in the next period After Correct before closing Receipt cost fixed through a transaction adjustment Recalculation re-costs dependent issues automatically Closing runs on correct receipt values Minutes of checks before close Practical takeaway Make a receipt-cost check part of your pre-closing routine. Look for receipts of the same item whose value per unit is far out of line with earlier receipts. Correct them through a transaction adjustment, recalculate, then close. 5. FAQs 1. Why not just correct the cost after closing? Because closing has already settled issues against the wrong receipt cost. Fixing it afterwards means either reversing the close or posting further adjustments in a later period. Both take far more work than a check before you close. 2. What does recalculation do that closing does not? Recalculation re-costs the dependent issues using the corrected receipt cost without finalising … Continue reading How a Multi-Country Oil & Gas and Marine Services Provider Corrected Receipt Costs Before Inventory Closing in Dynamics 365 Finance & Operations
How to Extend Dynamics 365 CRM Using Side Panes: A Practical Implementation for a US-Based Kitchen Appliance Manufacturer
Summary Our client is a US-based manufacturer of premium connected countertop cooking appliances, sold direct to consumers and through retail partners. Their in-house support team works warranty, returns and device troubleshooting cases in Dynamics 365, but the rules for handling those cases lived outside it, in documents that had to be opened in a second tab. We built what they call the troubleshoot guide using the side pane, a part of the app shell most implementations never touch because the out of the box app only uses it for the productivity pane and the Copilot panel. A Quick Reference Guide icon in the right-hand rail opens a business rules library beside the record, it stays open while the agent moves from one case to the next, and it is edited in place by the people who own the rules. The content sits in Dataverse rows instead of in a solution, so adding or correcting a rule is a data change rather than a deployment. This post covers why we chose that surface, the two design calls we reversed mid build, and the limits we would design around on a second pass. ⓘPart of a wider engagement The troubleshoot guide is one piece of a longer programme of Dynamics 365 enhancements, reporting and third-party integrations for this client. Read the full Customer Success Story. Table of Contents Summary→ Business Challenges→ Solution Overview→ Technical Approach→ Impact→ Conclusion→ Let’s Talk→ Business Challenges The problem was never that the rules did not exist. The problem was where they sat relative to the work. The handling rules lived in documents outside CRM, so finding the right paragraph meant leaving the case form and giving up the record context Rules changed more often than anyone could republish them, and a correction had to go back through whoever owned the file Nothing tied a rule to the moment it was needed. The agent already had the case open and still had to remember which policy applied Anything that put the content on a form tab would have turned a typo fix into a customisation, an export and an import ⚠The cost was the switch, not the search Opening a document is quick. Rebuilding where you were in a case after you come back is not, and that happened on every lookup. Solution Overview The troubleshoot guide is a side pane. Most users only ever meet that surface as the productivity pane in Customer Service, and most project teams reach for a dialog or a form tab because those are the shapes everyone already knows. The pane is the only one of the three that keeps the reference material and the record on screen together. The entry point is a Quick Reference Guide icon in the right-hand rail of the app. It is there as soon as a case is opened and on a case the agent is still creating, so somebody taking a call does not have to save the record first. The launcher sits in the right rail, available on an open case and on a new one. One click opens the pane, and it stays pinned as the agent moves to the next record. Content is organised in two levels: a business rule heading, and sub-sections under it, all collapsed when the pane first renders so the agent sees the index before the detail. The pane in the right column of the app shell, beside the live form. What the pane does Two level structure. A business rule heading holds any number of sub-sections. Everything renders collapsed, so the agent reads an index first and opens only the rule they need Search across both levels. One box matches heading names and the body text of every sub-section at the same time, and auto-expands whatever it hits. Clearing the box restores exactly which sections were open before the search started Inline authoring. Add a heading, add a sub-section, write bold text, colour a warning line, insert a link. No second screen and no admin rights Insert images two ways. Upload from the device, or point at an existing URL. Either way the image is resized and compressed before it is stored Paste from Word and Outlook. The rule owners draft in Word. Pasted formatting is cleaned on the way in, and a screenshot sitting in the clipboard is embedded as part of the same paste Sort by dragging. Headings reorder against each other, sub-sections reorder within their heading, and the new position is saved the moment the item is dropped Move a sub-section to a different heading. Drag it out of one section and onto another. A collapsed heading opens itself when the item hovers over it, so nothing has to be expanded first Light and dark themes. A toggle in the pane header, remembered per browser, because the pane is open all day beside a form whose theme the agent does not control Delete that deactivates. Removing a heading deactivates its sub-sections first, then the heading, so nothing is orphaned and nothing is destroyed ⓘNothing here is a customisation Every heading and every sub-section is a Dataverse row. Publishing a new rule does not touch the solution and does not need a developer. Technical Approach Why the side pane and not a form tab We looked at three places to put the guide before writing anything. The deciding criterion was not how it looked, it was what survives the agent moving to the next record. Criteria Form tab Custom page dialog Our choiceSide pane Readable at the same time as the case fields partial ✗ ✓ Survives navigating to the next case ✗ ✗ ✓ Width the agent can drag to suit their screen ✗ ✗ ✓ Keeps scroll position and open sections between records ✗ ✗ ✓ No change to the form layout to adopt it ✗ ✓ ✓ The side pane has been available in the Dynamics 365 app shell since 2021 and almost nothing in the standard app uses it beyond … Continue reading How to Extend Dynamics 365 CRM Using Side Panes: A Practical Implementation for a US-Based Kitchen Appliance Manufacturer
D365 CRM – Generating Emails using JavaScript via user actions for US based Azure & AI services company
Sending Dynamics 365 Emails from JavaScript with the Dataverse Web API | CloudFronts Summary Most Dynamics 365 emails are generated by workflows, Power Automate flows, or plugins reacting to a record change. But some notifications are triggered by a user action inside a custom UI, where the browser already holds all the context and the user needs to know immediately whether the email went out. In this implementation, we generated and sent Dynamics 365 email activities directly from JavaScript running in an HTML web resource, using only the Dataverse Web API. The email is created with sender and recipient activity parties, linked to a related record through the Regarding lookup, and sent through the SendEmail bound action for delivery by server-side synchronization. This article covers the problem, the use case, how an email is structured in Dataverse, and a step-by-step walkthrough of the JavaScript implementation, including the pitfalls we hit along the way. Table of Contents Problem Statement The Use Case Why Send Emails from JavaScript? Anatomy of an Email in Dataverse Solution Overview Step 1 — A Reusable Web API Helper Step 2 — Identifying the Sender Step 3 — Resolving the Recipient Dynamically Step 4 — Creating the Record the Email Will Be Regarding Step 5 — Composing the Subject and HTML Body Step 6 — Building the Activity Parties Step 7 — Binding the Regarding Lookup Step 8 — Creating the Email Record Step 9 — Sending the Email with SendEmail Understanding the Email Lifecycle The Complete Email Function Error Handling Testing and Validation Security and Production Considerations Key Implementation Lessons Conclusion Frequently Asked Questions This Blog Explains When a user action, rather than a record change, should be the trigger for an email. How an email activity, its activity parties, and its Regarding lookup fit together in Dataverse. How to create an email with From and To recipients through the Web API. The Regarding navigation property naming that commonly causes silent failures. The difference between creating an email and sending it. Why sent emails show as Pending Send, and what has to be configured for delivery. Read more about our Journey with this Customer over here: View Case Study | Refer my previous blog on the associated topic for more context Problem Statement Dynamics 365 offers several ways to send email automatically, and nearly all of them are record-driven: something is created or updated, and a workflow, flow, or plugin reacts to it. That model breaks down when the event worth notifying about is not a simple record change but an action a user performs in a custom interface, such as an HTML web resource or a custom page. In those cases: The trigger is a button click, and the relevant context (who acted, what changed, what the previous value was) lives in the browser. The email must only be sent once a multi-step operation has fully succeeded, not when it starts. The user expects immediate confirmation that the notification went out, or a clear message if it did not. The email should be a proper Dynamics 365 activity, visible on a related record’s timeline, not an untracked message sent from outside CRM. An asynchronous flow cannot give the user that immediate feedback, and a plugin would need to reconstruct context the UI already has. The question became: Can we create, link, and send a fully tracked Dynamics 365 email directly from the JavaScript that handles the user’s action, using only the Dataverse Web API? The Use Case The scenario was a custom Dataverse Choice (Option Set) Manager, an HTML web resource that lets authorized users add or relabel picklist values (for example, Lead Source) from within Dynamics 365.Building Self-Service Dataverse Choice Picklist values feed reports, business rules, flows, and integrations, so the Operations Lead needed to be informed every time one changed. The notification rules were: Rule Implication for the email Notify only after the change is published The email is generated as the final step, after PublishXml succeeds Send from the user who made the change The sender activity party is the signed-in user Send to whoever currently holds the Operations Lead role The recipient is resolved at runtime, not hard-coded Keep the email traceable The email is set Regarding a Picklist Changes Audit Log record Include full change details The HTML body lists action, time, user, entity, field, option name, value, and old label The picklist change itself is the trigger. Everything that follows in this article is about the email. Why Send Emails from JavaScript? Approach Fit for a user-action trigger Power Automate Runs asynchronously, so the user cannot be told in the same interaction whether the email was sent Classic workflow Record-driven and deprecated in favour of Power Automate for new development Plugin Needs a compiled, registered assembly and must reconstruct context the UI already holds JavaScript + Web API Runs in the same interaction, has full context, and reports success or failure to the user immediately Because the web resource runs inside Dynamics 365, each Web API call executes as the signed-in user. Their security roles still decide whether they can create an email, set its recipients, and send it. Anatomy of an Email in Dataverse Before writing any code, it helps to understand that an email in Dynamics 365 is not a single record with To and From text fields. It is an activity made up of several related pieces. email (activity) ├── subject ├── description → HTML body ├── directioncode → true = outgoing ├── statecode / statuscode │ ├── email_activity_parties (collection) │ ├── participationtypemask = 1 → From │ ├── participationtypemask = 2 → To │ ├── participationtypemask = 3 → CC │ └── participationtypemask = 4 → BCC │ └── partyid → systemuser / contact / account / lead … │ └── regardingobjectid → any activity-enabled table Piece What it does Email record Holds the subject, body, direction, and status Activity parties Separate records linking the email to each sender and recipient Regarding Polymorphic lookup … Continue reading D365 CRM – Generating Emails using JavaScript via user actions for US based Azure & AI services company
